﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGsBlockRefNodeDescMem : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGsBlockRefNodeDescMem(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGsBlockRefNodeDescMem obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGsBlockRefNodeDescMem()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGsBlockRefNodeDescMem(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public OdGsBlockRefNodeDescMem(OdDbStub layoutBlockId, OdGiSubEntityTraitsData tr, OdGeScale3d scale, bool bUsePlotStyles) : this(GlobalsPINVOKE.new_OdGsBlockRefNodeDescMem__SWIG_0(OdDbStub.getCPtr(layoutBlockId), OdGiSubEntityTraitsData.getCPtr(tr), OdGeScale3d.getCPtr(scale), bUsePlotStyles), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGsBlockRefNodeDescMem(OdGsBlockRefNodeDescMem c) : this(GlobalsPINVOKE.new_OdGsBlockRefNodeDescMem__SWIG_1(OdGsBlockRefNodeDescMem.getCPtr(c)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGsBlockRefNodeDescMem() : this(GlobalsPINVOKE.new_OdGsBlockRefNodeDescMem__SWIG_2(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbStub m_layoutBlockId
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.OdGsBlockRefNodeDescMem_m_layoutBlockId_get(this.swigCPtr);
				OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGsBlockRefNodeDescMem_m_layoutBlockId_set(this.swigCPtr, OdDbStub.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdDbStub m_layerId
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.OdGsBlockRefNodeDescMem_m_layerId_get(this.swigCPtr);
				OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGsBlockRefNodeDescMem_m_layerId_set(this.swigCPtr, OdDbStub.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdDbStub m_lineTypeId
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.OdGsBlockRefNodeDescMem_m_lineTypeId_get(this.swigCPtr);
				OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGsBlockRefNodeDescMem_m_lineTypeId_set(this.swigCPtr, OdDbStub.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public uint m_cmColor
		{
			get
			{
				uint result = GlobalsPINVOKE.OdGsBlockRefNodeDescMem_m_cmColor_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGsBlockRefNodeDescMem_m_cmColor_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public LineWeight m_lineWeight
		{
			get
			{
				LineWeight result = (LineWeight)GlobalsPINVOKE.OdGsBlockRefNodeDescMem_m_lineWeight_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGsBlockRefNodeDescMem_m_lineWeight_set(this.swigCPtr, (int)value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public double m_lineTypeScale
		{
			get
			{
				double result = GlobalsPINVOKE.OdGsBlockRefNodeDescMem_m_lineTypeScale_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGsBlockRefNodeDescMem_m_lineTypeScale_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public PlotStyleNameType m_plotStyleNameType
		{
			get
			{
				PlotStyleNameType result = (PlotStyleNameType)GlobalsPINVOKE.OdGsBlockRefNodeDescMem_m_plotStyleNameType_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGsBlockRefNodeDescMem_m_plotStyleNameType_set(this.swigCPtr, (int)value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdDbStub m_plotStyleNameId
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.OdGsBlockRefNodeDescMem_m_plotStyleNameId_get(this.swigCPtr);
				OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGsBlockRefNodeDescMem_m_plotStyleNameId_set(this.swigCPtr, OdDbStub.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdDbStub m_materialId
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.OdGsBlockRefNodeDescMem_m_materialId_get(this.swigCPtr);
				OdDbStub result = (intPtr == IntPtr.Zero) ? null : new OdDbStub(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGsBlockRefNodeDescMem_m_materialId_set(this.swigCPtr, OdDbStub.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public uint m_cmTransparency
		{
			get
			{
				uint result = GlobalsPINVOKE.OdGsBlockRefNodeDescMem_m_cmTransparency_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGsBlockRefNodeDescMem_m_cmTransparency_set(this.swigCPtr, value);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdGeScale3d m_scale
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.OdGsBlockRefNodeDescMem_m_scale_get(this.swigCPtr);
				OdGeScale3d result = (intPtr == IntPtr.Zero) ? null : new OdGeScale3d(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				GlobalsPINVOKE.OdGsBlockRefNodeDescMem_m_scale_set(this.swigCPtr, OdGeScale3d.getCPtr(value));
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;
	}
}
